{extends file="main.tpl"}
{block name=head}
<script type="text/javascript">
$(document).ready(function() {
  $("#party").autocomplete("getPartyNameAuto.php", 
	{    
		width: 150,     
		matchContains: true,
		mustMatch: false,
		minChars: 0,
		//multiple: true,
		highlight: false,
		//multipleSeparator: ",",
		selectFirst: true,
		formatItem: function(data, i, n, value) {   
		  return  value.split("|")[0];
	  }
  });
  $("#party").result(function(event, data, formatted) {
	  $("#partyId").val(data[1]);
	  $("#partyName").val(data[2]);
  });

  $("#incomingChallan").autocomplete("getInChallanAuto.php", 
	{    
		width: 150,     
		matchContains: true,
		mustMatch: false,
		minChars: 0,
		//multiple: true,
		highlight: false,
		//multipleSeparator: ",",
		selectFirst: true,
		formatItem: function(data, i, n, value) {   
		  return  value.split("|")[0];
	  }
  });
  $("#incomingChallan").result(function(event, data, formatted) {
	  $("#incomingIdAuto").val(data[1]);
	  $("#incChallan").val(data[2]);
  });

});
function getHide(theId){
  var dataString = "incomingId=" + theId;
	$.ajax({
		type: "GET",
		url: "getHide.php",
		data: dataString,
		success:function(data)
		{
			$("#getData").html(data);
	  }
	});
}
</script>
{/block}
{block name=body}
<form name="form1" id="form1" action="{$smarty.server.PHP_SELF}" method="post">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
	<tr>
		<td class="table1" align="center">Furnace : 
			<select name="fId" AUTOFOCUS>
				<option value="">Select</option>
				{html_options values=$furnaceArray.fId output=$furnaceArray.furnaceName selected=$selFId}
		  </select>
		</td>
		<td class="table1" align="center">
			Order By : 
			<select name="orderBy">
				<option value="DESC">Descending</option>
				<option value="ASC">Ascending</option>
			</select>
		</td>
		<!--td class="table1" align="center">Party :
			<input type="text" name="party" id="party"/>
			<input type="hidden" name="partyId" id="partyId" />
			<input type="hidden" name="partyName" id="partyName" />
		</td>
		<td class="table1" align="center">Incoming Challan :
			<input type="text" name="incomingChallan" id="incomingChallan" />
			<input type="hidden" name="incomingIdAuto" id="incomingIdAuto" />
			<input type="hidden" name="incChallan" id="incChallan" />
		</td-->
		<td class="table1" align="center">From : {html_select_date prefix="fromDate" start_year ="-0" end_year="+2" field_order="DMY" month_format="%m" day_value_format="%02d"}</td>
		<td class="table1" align="center">To : {html_select_date prefix="toDate" start_year ="-0" end_year="+2" field_order="DMY" month_format="%m" day_value_format="%02d"}</td>
		<td class="table1" align="center"><input type="submit" name="showData" class="link" value=" SHOW DATA " /></td>
	</tr>
</table>
</form>
{if $incArray != 0}
<table border="1" cellpadding="0" cellspacing="0" width="100%">
<tr>
	<!--td class="table1" align="center" valign="top">.&bull;.</td>
	<td class="table1" align="center" valign="top">_.:&bull;:._</td-->
	<td class="table1" align="center" valign="top">Batch No.</td>
	<td class="table1" align="center" valign="top">Inc.<br>Date</td>
	<td class="table1" align="center" valign="top">Inc.<br>Challan</td>
	<td class="table1" align="center" valign="top">Party</td>
	<td class="table1" align="center" valign="top">Material</td>
	<td class="table1" align="center" valign="top">Item</td>
	<td class="table1" align="center" valign="top">Process</td>
	<td class="table1" align="center" valign="top">In</td>
	<td class="table1" align="center" valign="top">Out</td>
	<td class="table1" align="center" valign="top">Cycle</td>
	<td class="table1" align="center" valign="top">Check Qty</td>
	<td class="table1" align="center" valign="top">Hardness<br>Required</td>
	<td class="table1" align="center" valign="top">Status</td>
	<td class="table1" align="center" valign="top">Reason</td>
</tr>
{section name=sec1 loop=$incArray}
  {section name=sec2 loop=$logArray[sec1]}
  <tr>
  	<!--td class="table2" align="center" valign="top" NOWRAP>
  		{if $logArray[sec1][sec2].pmrDone == 'Y'}
  		  <a href="processMonitoringEdit.php?incomingId={$incArray[sec1].incomingId}&logSheetId={$logArray[sec1][sec2].logSheetId}" style="color:green;" target="_blank">
  		  	PM Report
  		  </a>
  		{else}
  		  <a href="processMonitoring.php?logSheetId={$logArray[sec1][sec2].logSheetId}"> PM Report</a>
  		{/if}
  	</td>
  	<td class="table2" align="center" valign="top" NOWRAP>
  		{if $logArray[sec1][sec2].pmMasterId > 0}
  		  <a href="pmPrint.php?logSheetId={$logArray[sec1][sec2].logSheetId}&pmMasterId={$logArray[sec1][sec2].pmMasterId}" style="color:green;" target="_blank"> Print </a>
  		{else}
  		  &nbsp;
  		{/if}
  	</td-->
  	<td class="table2" align="center" valign="top" NOWRAP>{$logArray[sec1][sec2].furnace}/{$logArray[sec1][sec2].logsheetNo}</td>
  	<td class="table2" align="center" valign="top" style="font-size:10px;">{$logArray[sec1][sec2].IncomingDate}</td>
  	<td class="table2" align="center" valign="top">{$logArray[sec1][sec2].challan}</td>
  	<td class="table2" align="center" valign="top" style="font-size:10px;" NOWRAP>{$logArray[sec1][sec2].partyName}</td>
  	<td class="table2" align="center" valign="top" style="font-size:10px;">{$logArray[sec1][sec2].materialName}</td>
  	<td class="table2" align="center" valign="top" style="font-size:10px;">Item</td>
  	<td class="table2" align="center" valign="top" style="font-size:10px;">{$logArray[sec1][sec2].process}</td>
  	<td class="table2" align="center" valign="top">{$logArray[sec1][sec2].startTime}</td>
  	<td class="table2" align="center" valign="top">{$logArray[sec1][sec2].endTime}</td>
  	<td class="table2" align="center" valign="top">Cycle</td>
  	<td class="table2" align="center" valign="top" style="font-size:10px;">{$logArray[sec1][sec2].quantity}</td>
  	<td class="table2" align="center" valign="top">{$logArray[sec1][sec2].hardne}</td>
  	<td class="table2" align="center" valign="top">{$logArray[sec1][sec2].status}</td>
  	<td class="table2" align="center" valign="top">{$logArray[sec1][sec2].notOkReason}</td>
  </tr>
  {/section}
{/section}
</table>
{/if}
{/block}